#define _CRT_SECURE_NO_WARNINGS 1
bool isSameTree(struct TreeNode* p, struct TreeNode* q)
{

    if (((p != NULL) && (q == NULL)) || ((p == NULL) && (q != NULL)))
        return false;

    if ((p == NULL) && (q == NULL))
        return true;

    if (p->val != q->val)
        return false;

    bool lret = isSameTree(p->left, q->left);
    if (!lret)
        return false;

    bool rret = isSameTree(p->right, q->right);
    if (!rret)
        return false;

    return true;
}